package com.xidian.zhiancloud.controller.lz.warnforecast.basicsset;

import com.xidian.zhiancloud.dto.ResultDTO;
import com.xidian.zhiancloud.enums.GeneralResponseEnums;
import com.xidian.zhiancloud.model.KeyIndicatorWarnThresholdSet;
import com.xidian.zhiancloud.model.WarnLevelSet;
import com.xidian.zhiancloud.service.warnforecast.basicsset.KeyIndicatorWarnThresholdSetService;
import com.xidian.zhiancloud.service.warnforecast.basicsset.WarnLevelSetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 关键指标预警阈值设置
 */

@RestController
@RequestMapping("/keyIndicator")
public class KeyIndicatorWarnThresholdSetController {
    @Autowired
    private KeyIndicatorWarnThresholdSetService keyIndicatorWarnThresholdSetService;

    @GetMapping("/getList")
    public ResultDTO getList() {
        return ResultDTO.successOf(keyIndicatorWarnThresholdSetService.getList(), GeneralResponseEnums.SUCCESS);
    }
    @PostMapping("/update")
    public ResultDTO update(@RequestBody KeyIndicatorWarnThresholdSet keyIndicatorWarnThresholdSet) {
        keyIndicatorWarnThresholdSetService.update(keyIndicatorWarnThresholdSet);
        return ResultDTO.successOf(GeneralResponseEnums.SUCCESS);
    }
    @PostMapping("/delete")
    public ResultDTO delete(@RequestBody KeyIndicatorWarnThresholdSet keyIndicatorWarnThresholdSet) {
        keyIndicatorWarnThresholdSetService.delete(keyIndicatorWarnThresholdSet);
        return ResultDTO.successOf(GeneralResponseEnums.SUCCESS);
    }
    @PostMapping("/insert")
    public ResultDTO insert(@RequestBody KeyIndicatorWarnThresholdSet keyIndicatorWarnThresholdSet) {
        keyIndicatorWarnThresholdSetService.insert(keyIndicatorWarnThresholdSet);
        return ResultDTO.successOf(GeneralResponseEnums.SUCCESS);
    }

}
